feat(kvp): add ProvisioningReport abstraction over KvpPoolStore#310
Open
peytonr18 wants to merge 1 commit into
Open
feat(kvp): add ProvisioningReport abstraction over KvpPoolStore#310peytonr18 wants to merge 1 commit into
peytonr18 wants to merge 1 commit into
Conversation
Add a ProvisioningReport that converts to ordered KVP entries via a new ToKvp trait and persists with write_report. ToKvp is the seam for a future diagnostics report to reuse write_report unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #310 +/- ##
==========================================
+ Coverage 94.78% 94.88% +0.10%
==========================================
Files 19 20 +1
Lines 6348 6477 +129
==========================================
+ Hits 6017 6146 +129
Misses 331 331 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cjp256
reviewed
Jun 18, 2026
| /// Report timestamp (`timestamp` field), set to the current time | ||
| /// (RFC 3339) when the report is constructed. | ||
| timestamp: String, | ||
| /// Pre-provisioning type (`pps_type` field). Defaults to `None`. |
Contributor
There was a problem hiding this comment.
let's skip the default and just require it. caller can default to "None". but also, let's maintain the types here, e.g. ReportPpsType
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a
ProvisioningReporttype in thelibazureinit-kvpcrate that models a provisioning health report as structured data and persists it to a KVP pool as ordered key/value entries — replacing ad-hoc string building at the call site.What's included
ProvisioningReport— report withsuccess(agent, vm_id)anderror(agent, vm_id, reason)constructors pluswith_pps_type,with_documentation_url, andwith_extrabuilders. Fields are private; the success⇔no-reason / error⇔reason invariant is enforced through the constructors.ToKvptrait — converts a report into orderedVec<(String, String)>entries. Acts as the shared seam so a future diagnostics report can reusewrite_reportwithout changes here.write_report— persists entries viaKvpPoolStore::insert(upsert / last-write-wins).Testing
cargo llvm-cov: 100% region and line coverage forreport.rs.